<#assign ctx=request.contextPath/>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <link rel="apple-touch-icon" sizes="76x76" href="${ctx}/static/assets/img/apple-icon.png">
    <link rel="icon" type="image/png" href="${ctx}/static/assets/img/favicon.png">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>Login Page</title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
    <!--     Fonts and icons     -->
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" />
    <!-- CSS Files -->
    <link href="${ctx}/static/assets/css/now-ui-kit.css?v=1.1.0" rel="stylesheet" />
    <!-- CSS Just for demo purpose, don't include it in your project -->
    <link href="${ctx}/static/assets/css/demo.css" rel="stylesheet" />
    <!-- Canonical SEO -->
    <link rel="canonical" href="" />
    <!--  Social tags      -->
    <meta name="keywords" content="">
    <meta name="description" content="">
    
    
    
</head>

<body class="login-page sidebar-collapse">

    <!-- End Navbar -->
    <div class="page-header" filter-color="orange">
        <div class="page-header-image" style="background-image:url(${ctx}/static/assets/img/login.jpg)"></div>
        <div class="container">
            <div class="col-md-4 content-center">
                <div class="card card-login card-plain">
                    <form class="form" method="" action="">
                        <div class="header header-primary text-center">
                            <div class="logo-container">
                                <img src="${ctx}/static/assets/img/logo2.png" alt="">
                            </div>
                            <!--<h1>星火环球</h1>-->
                        </div>
                        <div class="content">
                            <div class="input-group form-group-no-border input-lg">
                                <!--<span class="input-group-addon">-->
                                    <!--<i class="now-ui-icons users_circle-08"></i>-->
                                <!--</span>-->
                                <input type="text" id="code"  name="code" class="form-control" placeholder="请输入谷歌安全码">
                            </div>

                            <input type="text" id="status"  name="status"  hidden="hidden"  value="1"	>
                            <div class="input-group form-group-no-border input-lg">
                                 <!--<img src="${ctx}/static/assets/img/test.jpg" /> -->
                            </div>
                        </div>
                        <div class="footer text-center">
                            <div id="login" class="btn btn-primary btn-round btn-lg btn-block">登录</div>
                        </div>
                        
                    </form>
                </div>
            </div>
        </div>
        <script src="${ctx}/static/assets/js/core/jquery.3.2.1.min.js" type="text/javascript"></script>

        <footer class="footer">
            <div class="container">
                
                <div class="copyright" style="float: none;">
                    &copy;
                    <script>
                        document.write(new Date().getFullYear())
                    </script>, Designed by Invision. Coded by Creative Tim.More Templates <a href="#" target="_blank" title="星火环球">星火环球</a> - Collect from <a href="#" title="星火环球" target="_blank">星火环球</a>
                    <script>
                        $("#login").click(function(){

                            var ctx ="${ctx}";
                            var code = $('#code').val();
//                            var nickName = $("#nickname").val();
//                            var password=$("#password").val();
                            var status=$("#status").val();
                            var code =$("#code").val();
                            console.log(code+'code')
                            if(code==null || code=="" || code=='undefined'){
                                alert("请先输入安全码");
                            }else{

//                                sessionStorage.getItem("nickname")
//                                sessionStorage.getItem("password")

                                $.ajax({
                                    url: ctx + "/user/login",
                                    type: "POST",
                                    data: {"nickname":sessionStorage.getItem("nickname"),"password":sessionStorage.getItem("password"),"status":status,"code":code},
                                    success:function(result) {
                                        if(result.code == 1) {
                                            location.href = '../index.html'; //后台主页
                                            sessionStorage.removeItem("nickname");
                                            sessionStorage.removeItem("password");
                                        }else {
                                            console.log(result.code)
                                            alert("安全码错误")
                                            //layer.msg(result.msg);
                                        }
                                    }

                                })

                            }

                        });


                    </script>
                </div>
            </div>
        </footer>
    </div>
</body>
<!--   Core JS Files   -->

<script src="${ctx}/static/assets/js/core/popper.min.js" type="text/javascript"></script>
<script src="${ctx}/static/assets/js/core/bootstrap.min.js" type="text/javascript"></script>
<!--  Plugin for Switches, full documentation here: http://www.jque.re/plugins/version3/bootstrap.switch/ -->
<script src="${ctx}/static/assets/js/plugins/bootstrap-switch.js"></script>
<!--  Plugin for the Sliders, full documentation here: http://refreshless.com/nouislider/ -->
<script src="${ctx}/static/assets/js/plugins/nouislider.min.js" type="text/javascript"></script>
<!--  Plugin for the DatePicker, full documentation here: https://github.com/uxsolutions/bootstrap-datepicker -->
<script src="${ctx}/static/assets/js/plugins/bootstrap-datepicker.js" type="text/javascript"></script>
<!-- Share Library etc -->
<script src="${ctx}/static/assets/js/plugins/jquery.sharrre.js" type="text/javascript"></script>
<!-- Control Center for Now Ui Kit: parallax effects, scripts for the example pages etc -->
<script src="${ctx}/static/assets/js/now-ui-kit.js?v=1.1.0" type="text/javascript"></script>

</html>